{include file="common/_header"}

<body>

<div class="x-body layui-anim layui-anim-up">
    <form class="layui-form">
        <input type="hidden" name="comment_id" value="{$data.id}">

<!--        <div class="layui-form-item">-->
<!--            <div class="layui-inline">-->
<!--                <label class="layui-form-label">商品名称</label>-->
<!--                <div class="layui-input-inline">-->
<!--                    -->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->


        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">评价内容</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" name="content" class="layui-textarea">{$data.data.content}</textarea>
            </div>
        </div>

        <div style="margin-top: 50px; float: right; margin-right: 50px;">
            <button type="button" lay-submit lay-filter="add" class="layui-btn">立即提交</button>
        </div>
    </form>
</div>
</body>


<script>


    layui.use(['form', 'layer', 'layedit', 'upload'], function () {

        var form = layui.form;
        var layedit = layui.layedit;

        form.on('submit(add)', function (data) {

            // data.field.detail = layui.layedit.getContent(index);

            $.ajax({
                'url': '/products/boxeappraise',
                'type': 'post',
                'data': data.field,
                'dataType': 'json',
                success: function (data) {
                    if (data.code == 1) {
                        layer.msg(data.msg, {
                            icon: 6,
                            time: 800,
                        }, function () {
                            window.parent.location.href = data.url;
                        })
                    } else if (data.code < 1) {
                        layer.msg(data.msg);
                    }
                }
            });
        });

    });


</script>

{include file="common/_bottom"}